package com.sun.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    private static final String INIT_VALUE = "1";

    @GetMapping("/hello")
    public Long hello(){
        return stringRedisTemplate.opsForValue().increment(INIT_VALUE);
    }
}
